package com.ruoqing.auth.controller;

import com.ruoqing.auth.service.impl.TokenServiceImpl;
import com.ruoqing.redis.vo.BaseResponse;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
	* @author YaoXian
	* @title: TokenRestApi
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 认证授权中心 - Token令牌端点
	* @date 2021-01-12 16:40
	*/
@RestController
@RequestMapping(path = "auth")
public class TokenRestApi {
		
		@Resource
		private TokenServiceImpl tokenService;
		
		/**
			* 统一退出登录接口
			* @param token 用户Token令牌
			* @return BaseResponse 统一响应对象
			*/
		@DeleteMapping(path = "/logout")
		public BaseResponse logout(String token){
				return tokenService.removeToken(token);
		}
}
